package io.qar.controller;

import com.yomahub.liteflow.core.FlowExecutor;
import com.yomahub.liteflow.flow.LiteflowResponse;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @program: flowable-spring-boot-example
 * @description:
 * @author: yyyyjinying
 * @create: 2023-09-19 13:43
 **/
@RestController
@RequestMapping("demo")
public class DemoController {

    @Resource
    private FlowExecutor flowExecutor;

    @GetMapping("executor")
    public String flowExecutorDemo() {
        LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
        System.out.println("response:" + response);
        return "ok";
    }
}
